package cn.TreeMenu.contoller;

import checkers.units.quals.C;
import cn.TreeMenu.entity.Do.Treemenu;
import cn.TreeMenu.entity.MChildren;
import cn.TreeMenu.service.impl.TreeMenuService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test {

    public static void main(String[] args) {
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("spring.xml");
        TreeMenuService treeMenuService = (TreeMenuService) applicationContext.getBean("treeMenuService");
        List<Treemenu> treemenus = treeMenuService.selectTreeMenu("1");
        for (Treemenu treemenu : treemenus) {
            System.out.println(treemenu.getId());
            if (treemenu.getChildrens().size() > 0){
                for ( MChildren children : treemenu.getChildrens()) {
                    System.out.println(children.getCicon());
                }
            }
        }
    }

}
